home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Diamond Collection / The Diamond Collection (Software Vault)(Digital Impact).ISO / cdr29 / irc2_026.zip / INSTALL.CMD < prev    next >
OS/2 REXX Batch file  |  1995-03-01  |  5KB  |  207 lines

  1. /* */
  2.  
  3.  call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysloadFuncs'
  4.  call SysLoadFuncs
  5.  
  6.  rc=Say_Warning()
  7.  rc=Handle_docs()
  8.  rc=Handle_help()
  9.  rc=Handle_script()
  10.  rc=Handle_trans()
  11.  rc=Save_files()
  12.  Say 'Unzipping the distribution File'
  13.  '@unzip  -qq -o distrib.zip' 
  14.  rc=Is_hpfs()
  15.  If rc = 1 Then '@unzip -qq -o hpfs.zip'
  16.  Say 'Finished unzipping the distribution zip files, now cleaning up.'
  17.  rc=Cleanup()
  18.  rc=Restore_files()
  19.  rc=Say_Info()
  20.  rc=Run_setup()
  21. exit
  22.  
  23. Say_Warning: Procedure
  24.  Call SysCls
  25.  say 'This install procedure does the following.'
  26.  say '[1] Deletes the help, script, docs and translation sub-directories'
  27.  say  '   if they exist.'
  28.  say '[2] Unzips the distribution zip file, and help files'
  29.  say '[3] Unzips extra help files if you are installing on HPFS'
  30.  say '[4] Cleans up after itself'
  31.  say '[5] Runs ircsetup.cmd to configure your irc session.'
  32.  say ' '
  33.  say 'If you wish to preserve files in some of these directories, then'
  34.  say 'interrupt the install with Ctrl-break now.'
  35.  say ' '
  36.  say ' The files ircserv.txt, ircrc, and irc2.ini will be preserved'
  37.  rc=SysSleep(2)
  38. return 1
  39.  
  40. Handle_docs: Procedure
  41.  curdir=directory()
  42.  curdir=curdir'\docs\primer.txt'
  43.  fname=stream(curdir,'C','Q EXISTS')
  44.  If fname<>'' Then 
  45.  Do 
  46.    Say 'Deleting .\docs'
  47.    '@delpath /y docs > nul'
  48.  End 
  49. return 1
  50.  
  51. Handle_help: Procedure
  52.  curdir=directory()
  53.  curdir=curdir'\help\cd'
  54.  fname=stream(curdir,'C','Q EXISTS')
  55.  If fname<>'' Then 
  56.  Do 
  57.    Say 'Deleting .\help'
  58.    '@delpath /y help > nul'
  59.  End 
  60. return 1
  61.  
  62. Handle_script: Procedure
  63.  curdir=directory()
  64.  curdir=curdir'\script\channel'
  65.  fname=stream(curdir,'C','Q EXISTS')
  66.  If fname<>'' Then 
  67.  Do 
  68.    Say 'Deleting .\script'
  69.    '@delpath /y script > nul'
  70.  End 
  71. return 1
  72.  
  73. Handle_trans: Procedure
  74.  curdir=directory()
  75.  curdir=curdir'\translation\ascii'
  76.  fname=stream(curdir,'C','Q EXISTS')
  77.  If fname<>'' Then 
  78.  Do 
  79.    Say 'Deleting .\translation'
  80.    '@delpath /y translation > nul'
  81.  End 
  82. return 1
  83.  
  84.  
  85. Save_files: Procedure
  86.  fname=stream("ircrc",'C','Q EXISTS')
  87.  If fname<>'' Then 
  88.  Do 
  89.    Say ' Copying your ircrc to ircrc_.old'
  90.  '@copy ircrc  ircrc_.old '
  91.  End 
  92.  
  93.  fname=stream("irc2.ini",'C','Q EXISTS')
  94.  If fname<>'' Then 
  95.  Do 
  96.    Say ' Copying your irc2.ini to irc2_ini.old'
  97.  '@copy irc2.ini irc2_ini.old '
  98.  End 
  99.  
  100.  fname=stream("ircserv.txt",'C','Q EXISTS')
  101.  If fname<>'' Then
  102.   Do
  103.    Say ' Copying your ircserv.txt to ircserv_.old'
  104.    '@copy ircserv.txt ircserv_.old '
  105.   End
  106.  
  107. return 1
  108.  
  109. Is_HPFS: Procedure
  110.  dname = systempfilename('junk.????')
  111.  rc=sysmkdir(dname)
  112.  If rc = 0 Then
  113.   Do
  114.    rc=sysrmdir(dname)
  115.    return 1
  116.   End
  117.  Else
  118.   return 0
  119.  
  120. Cleanup: Procedure
  121.  del_file.1='distrib.zip'
  122.  del_file.2='hpfs.zip'
  123.  del_file.3='delpath.exe'
  124.  del_file.4='unzip.exe'
  125.  del_file.5='install.cmd'
  126.  del_file.6='change.*'
  127.  del_file.0=6
  128.  
  129.  do i=1 to del_file.0
  130.    fname=stream(del_file.i,'C','Q EXISTS')
  131.    if fname <>'' Then rc=SysFileDelete(del_file.i)
  132.  End
  133. return 1
  134.  
  135. Restore_files: Procedure
  136.  Say 'Restoring any saved files'
  137.  fname=stream("ircrc_.old",'C','Q EXISTS')
  138.  say fname
  139.  If fname <>'' Then 
  140.  Do 
  141.    Say ' Restoring ircrc '
  142.   '@copy ircrc_.old ircrc '
  143.   '@del ircrc_.old '
  144.  End 
  145.  
  146.  fname=stream("irc2_ini.old",'C','Q EXISTS')
  147.  If fname <>'' Then 
  148.  Do 
  149.    Say ' Restoring your irc2.ini'
  150.  '@copy irc2_ini.old irc2.ini '
  151.  '@del irc2_ini.old'
  152.  End 
  153.  
  154.  fname=stream("ircserv_.old",'C','Q EXISTS')
  155.  If fname <>'' Then
  156.   Do
  157.    Say ' Restoring your ircserv.txt'
  158.    '@copy ircserv_.old ircserv.txt'
  159.    '@del ircserv_.old '
  160.   End
  161.  
  162. return 1
  163.  
  164. Say_Info: Procedure
  165.  Call SysCls
  166.  
  167.  say 'Irc has now been installed, and the install procedure will '
  168.  say 'now configure it, assuming you had not configured it previously.'
  169.  say 'The configure procedure will create an object on your desktop '
  170.  say 'which will run irc/2.  You can use this or irc.cmd to start irc/2'
  171.  say ' '
  172.  say 'Direct execution of irc2.exe is STRONGLY discouraged.'
  173.  say ' '
  174.  say 'If you wish to modify your irc/2 configuration after the initial '
  175.  say 'installation, please run ircsetup.cmd'
  176.  say ' '
  177.  say 'ircsetup will now be automatically invoked if required'
  178.  rc=SysSleep(15)
  179. return 1
  180.  
  181.  
  182. Run_setup: Procedure
  183.  
  184.  This_ircsetup_version = 2.0 
  185.  
  186.  fname=stream("irc2.ini",'C','Q EXISTS')
  187.  If fname = '' Then 
  188.   Do 
  189.    Say ' Configuring irc/2'
  190.   Call ircsetup
  191.   End
  192.  Else
  193.   Do
  194.       rc=SysIni("irc2.ini",'irc/2','ALL:','names')   
  195.       do i = 1 to names.0
  196.          val=SysIni("irc2.ini",'irc/2',names.i)
  197.          interpret names.i '= val'
  198.       end
  199.       No_need_to_run = 0
  200.       if Ircsetup_version = 'IRCSETUP_VERSION' Then No_need_to_run = 1
  201.       else if Ircsetup_version < This_ircsetup_version Then No_need_to_run = 1
  202.       if No_need_to_run = 1 Then Call Ircsetup
  203.  
  204.   End
  205.  
  206. return 1
  207.